home *** CD-ROM | disk | FTP | other *** search
/ Enciclopedia Del Perro / Enciclopedia Del Perro.iso / win / tfw115c1 / tfw.5 / SETTINGS.SLT < prev    next >
Text File  |  1996-04-15  |  4KB  |  96 lines

  1. /****************************************************************/
  2. /*                                                              */
  3. /*  Demo of how to get, set, and display contents of various    */
  4. /*  TFW communications/terminal devices, sound, etc.            */
  5. /*                                                              */
  6. /*                   Copyright 1995 deltaComm Development, Inc. */
  7. /*                                                              */
  8. /****************************************************************/
  9.  
  10. main()
  11. {
  12. int b, p, d, s;
  13. str ss[30];
  14.  
  15. printsc("         Baud rate: ");
  16. gets(ss);                                    // Get a strings from the user
  17. b=stoi(ss);                                  // and convert it to an integer
  18. prints();                                    // before displaying it here
  19.  
  20. printsc("            Parity: ");             // Lather, rinse, repeat for each
  21. gets(ss);                                    // of the possible comm params.
  22. p=stoi(ss);
  23. prints();
  24.  
  25. printsc("         Data bits: ");
  26. gets(ss);
  27. d=stoi(ss);
  28. prints();
  29.  
  30. printsc("         Stop bits: ");
  31. gets(ss);
  32. s=stoi(ss);
  33. prints();
  34.  
  35. set_cparams(b, p, d, s);                     // Set parameters using user input
  36.  
  37. s=numconnectdevices();                       // Get a count of connect devices
  38. b=0;                                         // Zero out B for use as temp var.
  39.  
  40. while (s>b)                                  // While devices still remain...
  41.  {                                           // loop through each and display
  42.   b=b+1;                                     // each one by name.
  43.   printsc("Device #");
  44.   printn(b);
  45.   printsc("   ");
  46.   connectdevicename(b, ss);
  47.   prints(ss);
  48.  }
  49.  
  50. printsc("   Activate Device: ");
  51. gets(ss);                                    // Get user input and then set
  52. set_connectdevice(ss);                       // connect device according to it
  53. prints();
  54.  
  55. printsc("Terminal Emulation:");              // Again, lather, rinse, repeat
  56. gets(ss);                                    // for terminals, protocols, and
  57. set_terminal(ss);                            // others (Translate Tables).
  58. prints();
  59.  
  60. printsc("  Default Protocol:");
  61. gets(ss);
  62. set_defprot(ss);
  63. prints();
  64.  
  65. printsc("Load incoming translation table? (y/n)");
  66.  
  67. s=inkeyw();                                  // Wait for an answer to the ???
  68. toupper(s);                                  // Convert the answer to uppercase
  69. if (s=="Y")                                  // If the answer is "yes", then
  70.   transtab("", 0);                           // Load incoming translate table,
  71. prints();                                    // prompting for filename w/ ""
  72.  
  73. printsc("Load outgoing translation table? (y/n)");
  74. s=inkeyw();
  75. toupper(s);                                  // Lather, rinse, repeat for
  76. if (s=="Y")                                  // outbound table.  Don't accept
  77.   transtab("", 1);                           // a shampoo.  Demand REAL poo!
  78. prints();
  79.  
  80. printsc("Enable sound? <y/n>");              // Finally, allow the user to
  81. s=inkeyw();                                  // select sound, keeping in mind
  82. tolower(s);                                  // that in Cyberspace, EVERYONE
  83. if (s=='y')                                  // can hear you scream....
  84.  {
  85.   _sound_on=1;
  86.   printsc("Enable alarm? <y/n>");
  87.   s=inkeyw();
  88.   tolower(s);
  89.   if (s=='y') _alarm_on=1;
  90.   else _alarm_on=0;
  91.  }
  92. else
  93.  _sound_on=0;
  94.  
  95. }
  96.